﻿#include <iostream>
using namespace std;
//#pragma pack(1) //修改结构体内存对齐;
int main()
{
	struct info_person
	{
		char name[21];
		int age;
		char sex;
		double weight;
		bool hello;
	}person{ "三毛" ,30,'X',77.8,false };
	//info_person person{ "三毛" ,30,'X',77.8,false }; // 创建结构体变量
	cout << "sizeof(person)" << sizeof(person) << endl;
	memset(&person, 0, sizeof(person));//清空结构体
	cout << "姓名：" << person.name << "、年龄：" << person.age << "、性别：" << person.sex
		<< "、体重：" << person.weight << "、咋样：" << person.hello << endl;
}


